extends Control

@export var baby_cry:AudioStream
@export var baby_laugh:AudioStream

@onready var eazy_button: Button = %EazyButton
@onready var normal_button: Button = %NormalButton
@onready var diffcult_button: Button = %DiffcultButton
@onready var baby_stream: AudioStreamPlayer = $BabyStream
@onready var return_button: Button = $ReturnButton


func _ready() -> void:
	if Global.current_setting.get("MODE",1) == 2:
		diffcult_button.button_pressed = true
	elif Global.current_setting.get("MODE", 1) == 1:
		normal_button.button_pressed = true
	else:
		eazy_button.button_pressed = true
	eazy_button.pressed.connect(on_eazy_pressed)
	normal_button.pressed.connect(on_normal_pressed)
	diffcult_button.pressed.connect(on_difficult_pressed)
	return_button.pressed.connect(GuiTransitions.go_to.bind("Menu"))



func on_eazy_pressed() -> void:
	baby_stream.stream = baby_laugh
	baby_stream.play()
	Global.current_setting.set("MODE",0)
	SaveManager.save_set()

func on_normal_pressed() -> void:
	Global.current_setting.set("MODE",1)
	SaveManager.save_set()

func on_difficult_pressed() -> void:
	baby_stream.stream = baby_cry
	baby_stream.play()
	Global.current_setting.set("MODE",2)
	SaveManager.save_set()
